home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / vlib250.zip / VISUALIB.H < prev    next >
C/C++ Source or Header  |  1994-10-31  |  34KB  |  863 lines

  1. /*****************************************************************************
  2.  
  3.                     Visualib Header File
  4.                     Copyright (c) 1994
  5.                     Visual Tech Co.
  6.                     P.O.Box 8735
  7.                     Fort Wayne, IN 46898-8735
  8.  
  9. *****************************************************************************/
  10.  
  11. /*****************************************************************************
  12.  
  13.                     Constants, types, and Macros
  14.  
  15. *****************************************************************************/
  16.  
  17. #ifdef    __cplusplus
  18. extern    "C" {
  19. #endif
  20.  
  21. typedef DWORD    HVIEW;
  22. typedef DWORD    HMATE;
  23. typedef DWORD    HLITE;
  24.  
  25. #define REAL    double
  26. #ifndef    WIN32
  27. typedef int        INT;
  28. #endif
  29.  
  30. #define VOIDED VOID WINAPI
  31. #define INTEGER INT WINAPI
  32. #define BOOLEAN BOOL WINAPI
  33. #define SGLWORD WORD WINAPI
  34. #define    DBLWORD DWORD WINAPI
  35. #define    STRING LPSTR WINAPI
  36. #define    VIEWHDL HVIEW WINAPI
  37. #define MATEHDL HMATE WINAPI
  38. #define LITEHDL HLITE WINAPI
  39.  
  40. typedef REAL FAR    *LPREAL;
  41. typedef REAL FAR    *VECTOR;
  42. typedef REAL FAR    *MATRIX;
  43.  
  44. typedef REAL        VECTOR2[2];
  45. typedef REAL        VECTOR3[3];
  46. typedef REAL        VECTOR4[4];
  47. typedef REAL        MATRIX2D[9];
  48. typedef REAL        MATRIX3D[16];
  49. typedef VECTOR2    FAR    *LPVECT2;
  50. typedef VECTOR3    FAR    *LPVECT3;
  51. typedef    VECTOR4 FAR    *LPVECT4;
  52. typedef VECTOR FAR    *LPVECTOR;
  53.  
  54. typedef struct _tagPOINT2D {        /* 2D point coordinates */
  55.     REAL    x, y;
  56. } POINT2D, FAR *LPPOINT2D;
  57.  
  58. typedef struct _tagPOINT2H {        /* 2D homogeneous point coordinates */
  59.     REAL    x, y, w;
  60. } POINT2H, FAR *LPPOINT2H;
  61.  
  62. typedef struct _tagPOINT3D {        /* 3D point coordinates */
  63.     REAL    x, y, z;
  64. } POINT3D, FAR *LPPOINT3D;
  65.  
  66. typedef struct _tagPOINT3H {        /* 3D homogeneous point coordinates */
  67.     REAL    x, y, z, w;
  68. } POINT3H, FAR *LPPOINT3H;
  69.  
  70. typedef struct _tagBOX2D {
  71.     REAL    xmin, xmax, ymin, ymax;
  72. } BOX2D, FAR *LPBOX2D;
  73.  
  74. typedef struct _tagBOX3D {
  75.     REAL    xmin, xmax, ymin, ymax, zmin, zmax;
  76. } BOX3D, FAR *LPBOX3D;
  77.  
  78. typedef struct tagFACET {
  79.     INT        npts;
  80.     VECTOR3 normal;
  81.     LPINT    vindex;
  82.     LPINT    nindex;
  83. } FACET, FAR *LPFACET;
  84.  
  85. typedef struct tagWIRE {
  86.     INT    vert1;
  87.     INT    vert2;
  88. } WIRE, FAR *LPWIRE;
  89.  
  90. typedef struct tagPOLYFACET {
  91.     INT        nvert;
  92.     INT        nnorm;
  93.     INT        nfacet;
  94.     INT        nwire;
  95.     LPPOINT3D    vertex;
  96.     LPVECT3        normal;
  97.     LPFACET        facet;
  98.     LPWIRE        wire;
  99. } POLYFACET, FAR *LPPOLYFACET;
  100.  
  101. typedef MATRIX3D FAR    *LPMTRX3D;
  102. typedef MATRIX2D FAR    *LPMTRX2D;
  103.  
  104. #define EPSILON (REAL) 1e-5
  105. #define QUTRPI    (REAL) 0.78539816339744810711
  106. #define HALFPI    (REAL) 1.57079632679489621423
  107. #define PI        (REAL) 3.14159265358979323846
  108. #define TWOPI    (REAL) 6.28318530717958647692
  109. #define DTOR    (REAL) 0.0174532
  110. #define ATOR    (REAL) 1.7453293e-3
  111. #define RTOD    (REAL) 57.295779
  112. #define    SQRT2    (REAL)1.414214
  113. #define    SQRT3    (REAL)1.732051
  114.  
  115. /* coordinate type */
  116. #define    VL_2D    0x1000
  117. #define    VL_3D    0x2000
  118. #define    VL_2H    0x0400
  119. #define    VL_3H    0x0800
  120.  
  121. /* viewer status flag */
  122. #define    VL_TWOD            8
  123. #define    VL_THREED        16
  124. #define    VL_CURRENT        0x0100
  125. #define    VL_DEFAULT        0x1000
  126. #define    VL_DEFAULT2D    0x1100
  127.  
  128. /* light coordinate mode */
  129. #define    VL_WORLDLIGHT        0x0001
  130. #define    VL_CAMERALIGHT        0x0002
  131. #define    VL_OBJECTLIGHT        0x0004
  132.  
  133. /* light type */
  134. #define    VL_POINTLIGHT        0x0100
  135. #define    VL_DISTLIGHT        0x0200
  136. #define    VL_SPOTLIGHT        0x0400
  137. #define VL_AREALIGHT        0x0800
  138.  
  139. #define VL_INQUIRE            0xFFFFFFFF
  140. #define    VL_PERTURBMATERIAL    0x0B00
  141. #define VL_PERTURBNORMAL    0x0C00
  142. #define    VL_PERTURBPIXEL        0x0D00
  143. #define VL_PERTURBFACET        0x0E00
  144.  
  145. /* projection mode */
  146. #define VL_PROJECTIONMODE    0x03
  147. #define VL_PERSPECTIVE        0x01
  148. #define VL_ORTHOGONAL        0x02
  149.  
  150. /* standard pen and brush color */
  151. #define    VL_NONE            0
  152. #define VL_RED            1
  153. #define VL_GREEN        2
  154. #define VL_BLUE            3
  155. #define VL_BROWN        4
  156. #define VL_MAGENTA        5
  157. #define VL_CYAN            6
  158. #define VL_WHITE        7
  159. #define VL_GRAY            8
  160. #define VL_LIGHTRED        9
  161. #define VL_LIGHTGREEN    10
  162. #define VL_LIGHTBLUE    11
  163. #define VL_YELLOW        12
  164. #define VL_LIGHTMAGENTA    13
  165. #define VL_LIGHTCYAN    14
  166. #define VL_LIGHTGRAY    15
  167. #define VL_BLACK        16
  168.  
  169. /* shading method */
  170. #define    VL_WIREFRAME        0x0001
  171. #define    VL_SOLIDFILL        0x0002
  172. #define    VL_CONTOURSHADE        0x0004
  173. #define    VL_GOURAUDSHADE        0x0008
  174. #define    VL_PHONGSHADE        0x0010
  175. #define    VL_FLATSHADE        0x0020
  176.  
  177. /* shading model */
  178. #define    VL_PHONGMODEL        0x0100
  179. #define    VL_SPECULARMODEL    0x0200
  180.  
  181. /* mark type */
  182. #define    VL_NULLMARK            0x0000
  183. #define    VL_CIRCLEMARK        0x0001
  184. #define    VL_CROSSMARK        0x0002
  185. #define    VL_XMARK            0x0004
  186. #define    VL_TRIANGLEMARK        0x0008
  187. #define    VL_BOXMARK            0x0010
  188. #define    VL_DIAMONDMARK        0x0020
  189. #define    VL_HEXAGONMARK        0x0040
  190. #define    VL_OCTAGONMARK        0x0080
  191.  
  192. /* arrow head type */
  193. #define    VL_NULLARROW        0x0000
  194. #define    VL_OPENARROW        0X0100
  195. #define    VL_CLOSEDARROW        0X0200
  196.  
  197. /* position mark type */
  198. #define    VL_CROSSHAIR    1
  199. #define    VL_ORIGIN        2
  200.  
  201. /* solid texture flag */
  202. #define    VL_MARBLE        0x0001
  203. #define    VL_WOODGRAIN    0x0002
  204. #define    VL_GRANITE        0x0004
  205. #define    VL_BUMPY        0x0008
  206.  
  207. /* Useful Macros */
  208. #define ABS(x)        (((x)>0)?(x):-(x))
  209. #define TRUNC(x)    ((INT) (x))
  210. #define    FLOOR(x)    (((x)>0) ? (INT)(x) : -(INT)(-(x)+1))
  211. #define    CEILING(x)    ((x)==(INT)(x)?(x):(((x)>0)?1+(INT)(x):-(1+(INT)(-(x)))))
  212. #define    ROUND(x)    ((x)>0 ? (INT)(x+0.5f) : -(INT)(0.5f-x))
  213. #define SQR(x)        ((x)*(x))
  214. #define SQR2(x,y)    ((REAL)(SQR(x)+SQR(y)))
  215. #define SQR3(x,y,z)    ((REAL)(SQR(x)+SQR(y)+SQR(z)))
  216.  
  217. #define MAX(a,b)    (((a) > (b)) ? (a) : (b))
  218. #define MIN(a,b)    (((a) < (b)) ? (a) : (b))
  219. #define    SWAP(a,b)    { a^=b; b^=a; a^=b; }
  220. #define MIDVAL(a,b)    (((a) + (b)) * 0.5f)
  221. #define    LERP(a,l,h)    ((l) + (((h) - (l)) * (a)))
  222. #define    CLAMP(v,l,h)    ((v) < (l) ? (l) : (v) > (h) ? (h) : (v))
  223. #define    STEP(v,s)    ((v) < (s) ? 0 : 1)
  224. #define    SIGN(x)        (((x) < 0) ? -1 : (x) > 0 ? 1 : 0)
  225.  
  226. #define    NEWLIST(type,n)    (type FAR *)_fmalloc (sizeof (type) * (n))
  227. #define    NEWITEM(type)    (type FAR *)_fmalloc (sizeof (type))
  228. #define    FREE(p)            _ffree(p)
  229. #define    EXIT            goto exit
  230. #define    NEXT(ptr)        ptr = (ptr)->next
  231. #define PREV(ptr)        ptr = (ptr)->prev
  232.  
  233. #define DIST2(x,y)            ((REAL)sqrt(SQR2(x,y)))
  234. #define DIST3(x,y,z)        ((REAL)sqrt(SQR3(x,y,z)))
  235. #define DETERM2(a,b,c,d)    ((a) * (d) - (b) * (c))
  236. #define DETERM3(a,b,c,d,e,f,g,h,i) ((a)*DETERM2(e,f,h,i)+(b)*DETERM2(f,d,i,g)+(c)*DETERM2(d,e,g,h))
  237.  
  238. #define VSET2(v,x,y)        ((v)[0]=(x),(v)[1]=(y))
  239. #define VSET3(v,x,y,z)        ((v)[0]=(x),(v)[1]=(y),(v)[2]=(z))
  240. #define VSET4(v,x,y,z,w)    ((v)[0]=(x),(v)[1]=(y),(v)[2]=(z),(v)[3]=(w))
  241. #define    VGET2(v,x,y)        (x=(v)[0],y=(v)[1])
  242. #define    VGET3(v,x,y,z)        (x=(v)[0],y=(v)[1],z=(v)[2])
  243. #define    VGET4(v,x,y,z,w)    (x=(v)[0],y=(v)[1],z=(v)[2],w=(v)[3])
  244.  
  245. #define    VDOT(a,b)            ((a[0]*b[0])+(a[1]*b[1])+(a[2]*b[2]))
  246. #define    VDOT2(a,b)            ((a[0]*b[0])+(a[1]*b[1]))
  247. #define    VABS(a)                (REAL)sqrt(VDOT(a, a))
  248. #define    VABS2(a)            (REAL)sqrt(VDOT2(a, a))
  249.  
  250. /*****************************************************************************
  251.  
  252.                     Function Prototypes
  253.  
  254. *****************************************************************************/
  255.  
  256. /*****************************************************************************
  257.  
  258.                     Math Functions
  259.  
  260. *****************************************************************************/
  261.  
  262. BOOLEAN    vunify (VECTOR a, VECTOR b);
  263. VOIDED    vadd (VECTOR a, VECTOR b, VECTOR c);
  264. VOIDED    vsub (VECTOR a, VECTOR b, VECTOR c);
  265. VOIDED    dotproduct (VECTOR a, VECTOR b, LPREAL result);
  266. VOIDED    crossproduct (VECTOR a, VECTOR b, VECTOR c);
  267. VOIDED    mixproduct (VECTOR a, VECTOR b, VECTOR c, LPREAL result);
  268. BOOLEAN    vcos (VECTOR a, VECTOR b, LPREAL result);
  269. BOOLEAN    vsin (VECTOR a, VECTOR b, LPREAL result);
  270. BOOLEAN    vangle (VECTOR a, VECTOR b, LPREAL result);
  271. BOOLEAN    vpara (VECTOR a, VECTOR b);
  272. BOOLEAN    vperp (VECTOR a, VECTOR b);
  273. BOOLEAN    vflat (VECTOR a, VECTOR b, VECTOR c);
  274.  
  275. /*****************************************************************************
  276.  
  277.                     Basic Functions
  278.  
  279. *****************************************************************************/
  280.  
  281. BOOLEAN    InitializeVisualib (void);
  282. VOIDED    ExitVisualib (void);
  283. VOIDED    AboutVisualib (void);
  284. VOIDED    LicenseInfo (void);
  285.  
  286. /* utility functions */
  287. int FAR CDECL    Message (WORD flag, LPSTR title, LPSTR format, ...);
  288. COLORREF WINAPI    SelectColor (COLORREF color);
  289.  
  290. VOIDED    SetPoint2D (LPPOINT2D point, REAL x, REAL y);
  291. VOIDED    SetPoint3D (LPPOINT3D point, REAL x, REAL y, REAL z);
  292. VOIDED    SetPoint2H (LPPOINT2H point, REAL x, REAL y, REAL w);
  293. VOIDED    SetPoint3H (LPPOINT3H point, REAL x, REAL y, REAL z, REAL w);
  294. VOIDED    SetBox2D (LPBOX2D box, REAL xmin, REAL xmax, REAL ymin, REAL ymax);
  295. VOIDED    SetBox3D (LPBOX3D box, REAL xmin, REAL xmax, REAL ymin, REAL ymax, REAL zmin, REAL zmax);
  296.  
  297. VOIDED    PenColor (HDC hdc, WORD color_index);
  298. VOIDED    BrushColor (HDC hdc, WORD color_index);
  299. VOIDED    TextColor (HDC hdc, WORD tcolor, WORD bcolor);
  300. VOIDED    PaintColor (HDC hdc, WORD pen_color, WORD brush_color);
  301.  
  302. BOOLEAN    DeleteViewer (HVIEW hv);
  303. VIEWHDL    NewViewer (WORD type);
  304. VOIDED    FreeViewer (HVIEW hv);
  305. DBLWORD    ViewerBackgroundColor (HVIEW hv, COLORREF color);
  306.  
  307. SGLWORD    ViewerMappingMode (HVIEW hv, WORD mode);
  308. BOOLEAN    CopyViewer (HVIEW hv1, HVIEW hv2);
  309. VIEWHDL    SelectViewer (HVIEW hv);
  310. BOOLEAN    SetViewerFrame (HVIEW hv, LPRECT frame);
  311. BOOLEAN    GetViewerFrame (HVIEW hv, LPRECT frame);
  312. BOOLEAN    CleanViewer (HDC hdc, HVIEW hv);
  313. DBLWORD    ViewerBackgroundColor (HVIEW hv, COLORREF color);
  314. STRING    ViewerName (HVIEW hv, LPSTR name);
  315. BOOLEAN    DisplayViewerFrame (HDC hdc, HVIEW hv);
  316. BOOLEAN    DisplayViewerName (HDC hdc, HVIEW hv, BOOL top);
  317.  
  318. BOOLEAN    BeginDoubleBuffer (LPHANDLE hdc);
  319. BOOLEAN    EndDoubleBuffer (LPHANDLE hdc);
  320. BOOLEAN    UpdateDoubleBuffer (HDC hdc);
  321.  
  322. /*****************************************************************************
  323.  
  324.                         2D Functions
  325.  
  326. *****************************************************************************/
  327.  
  328. VOIDED    Translate2D (REAL x, REAL y);
  329. VOIDED    TranslateTo2D (REAL x, REAL y);
  330. VOIDED    Scale2D (REAL x, REAL y);
  331. VOIDED    PointScale2D (REAL x, REAL y, REAL sx, REAL sy);
  332. VOIDED    TranScale2D (REAL x, REAL y, REAL sx, REAL sy);
  333. VOIDED    Shear2D (REAL x, REAL y, REAL a, REAL u, REAL v);
  334. VOIDED    Stretch2D (REAL x, REAL y, REAL a, REAL f);
  335. VOIDED    Mirror2D (REAL x, REAL y, REAL a);
  336. VOIDED    Rotate2D (REAL angle);
  337. VOIDED    PointRotate2D (REAL x, REAL y, REAL a);
  338. BOOLEAN    ViewerField2D (HVIEW hv,
  339.             LPREAL left, LPREAL bottom, LPREAL right, LPREAL top);
  340.  
  341. BOOLEAN    PushTransformation2D (MATRIX m);
  342. BOOLEAN    PopTransformation2D (MATRIX m);
  343. VOIDED    ConcatTransformation2D (MATRIX m, BOOL post);
  344. VOIDED    LoadTransformation2D (MATRIX m);
  345.  
  346. BOOLEAN    SetProjection2D (HVIEW hv,
  347.             REAL left, REAL bottom, REAL right, REAL top);
  348. BOOLEAN    SetView2D (HVIEW hv, REAL x, REAL y, REAL a);
  349. BOOLEAN    SetWindow2D (HVIEW hv, REAL left, REAL bottom, REAL right, REAL top);
  350.  
  351. BOOLEAN    MoveViewer2D (HVIEW hv, REAL horizontal, REAL vertical, BOOL local);
  352. BOOLEAN    RotateViewer2D (HVIEW hv, REAL angle, BOOL local);
  353. BOOLEAN    ZoomViewer2D (HVIEW hv, REAL zoom);
  354.  
  355. VOIDED    MoveTo2D (HDC hdc, REAL x, REAL y);
  356. VOIDED    LineTo2D (HDC hdc, REAL x, REAL y);
  357. VOIDED    Line2D (HDC hdc, REAL x1, REAL y1, REAL x2, REAL y2);
  358. VOIDED    Line2D (HDC hdc, REAL x1, REAL y1, REAL x2, REAL y2);
  359.  
  360. VOIDED    RMoveTo2D (HDC hdc, REAL x, REAL y);
  361. VOIDED    RLineTo2D (HDC hdc, REAL x, REAL y);
  362. VOIDED    RLine2D (HDC hdc, REAL x, REAL y, REAL dx, REAL dy);
  363. VOIDED    Label2D (HDC hdc, REAL x, REAL y, LPSTR label);
  364.  
  365. VOIDED    MoveTo2H (HDC hdc, REAL x, REAL y, REAL w);
  366. VOIDED    LineTo2H (HDC hdc, REAL x, REAL y, REAL w);
  367. VOIDED    Line2H (HDC hdc, REAL x1, REAL y1, REAL w1,
  368.             REAL x2, REAL y2, REAL w2);
  369.  
  370. VOIDED    Polygon2D (HDC hdc, WORD type, VECTOR vertex, INT count);
  371. VOIDED    PolyPolygon2D (HDC hdc, WORD type, VECTOR vertex,
  372.             LPINT polycount, INT count);
  373. VOIDED    Polyline2D (HDC hdc, WORD type, VECTOR point, INT count);
  374. VOIDED    ClosedPolyline2D (HDC hdc, WORD type, VECTOR point, INT count);
  375. VOIDED    Mark2D (HDC hdc, REAL x, REAL y, INT hsize, INT vsize, WORD head);
  376. VOIDED    PolyMark2D (HDC hdc, WORD type, VECTOR point, INT count,
  377.             INT hsize, INT vsize, WORD head);
  378. VOIDED    Pointer2D (HDC hdc, REAL x1, REAL y1, REAL x2, REAL y2,
  379.             REAL l, REAL w, WORD type);
  380. VOIDED    Arrow2D (HDC hdc, REAL x, REAL y, REAL u, REAL v, REAL r, REAL l, 
  381.             REAL w, WORD type);
  382. VOIDED    Net2D (HDC hdc, WORD type, VECTOR point, INT m, INT n);
  383. VOIDED    MarkPosition2D (HDC hdc, REAL x, REAL y, REAL size, WORD type);
  384.  
  385. /*****************************************************************************
  386.  
  387.                         3D Functions
  388.  
  389. *****************************************************************************/
  390.  
  391. SGLWORD    ProjectionMode (HVIEW hv, DWORD mode);
  392.  
  393. VOIDED    Translate3D (REAL x, REAL y, REAL z);
  394. VOIDED    TranslateTo3D (REAL x, REAL y, REAL z);
  395. VOIDED    Scale3D (REAL sx, REAL sy, REAL sz);
  396. VOIDED    PointScale3D (REAL x, REAL y, REAL z, REAL sx, REAL sy, REAL sz);
  397. VOIDED    Rotate3D (REAL angle, char axis);
  398. VOIDED    AxleRotate3D (VECTOR ref, VECTOR dir, REAL a);
  399. VOIDED    Stretch3D (VECTOR ref, VECTOR dir, REAL f);
  400. VOIDED    Shear3D (VECTOR ref, VECTOR dir, REAL u, REAL v);
  401. VOIDED    Mirror3D (VECTOR ref, VECTOR dir);
  402.  
  403. BOOLEAN    PushTransformation3D (MATRIX m);
  404. BOOLEAN    PopTransformation3D (MATRIX m);
  405. VOIDED    ConcatTransformation3D (MATRIX m, BOOL post);
  406. VOIDED    LoadTransformation3D (MATRIX m);
  407.  
  408. BOOLEAN    SetProjection3D (HVIEW hv, REAL left, REAL bottom, REAL right,
  409.             REAL top, REAL front, REAL back, BYTE mode);
  410. BOOLEAN    SetPerspective (HVIEW hv, REAL fovy, REAL aspect,
  411.             REAL zmin, REAL zmax);
  412. BOOLEAN    SetView3D (HVIEW hv, REAL ex, REAL ey, REAL ez,
  413.             REAL ax, REAL ay, REAL az, REAL twist);
  414. BOOLEAN    SetPolarView (HVIEW hv, REAL ax, REAL ay, REAL az,
  415.             REAL dist, REAL azim, REAL inc, REAL twist);
  416.  
  417. BOOLEAN    ViewerLocation (HVIEW hv, LPREAL x, LPREAL y, LPREAL z);
  418. BOOLEAN    ViewerDirection (HVIEW hv, LPREAL x, LPREAL y, LPREAL z);
  419. BOOLEAN    ViewerField3D (HVIEW hv, LPREAL left, LPREAL bottom,
  420.             LPREAL right, LPREAL top, LPREAL front, LPREAL back);
  421.  
  422. BOOLEAN    MoveViewer3D (HVIEW hv, REAL horizontal, REAL vertical,
  423.             REAL backforth, BOOL local);
  424. BOOLEAN    RotateViewer3D (HVIEW hv, REAL angle, char axis, BOOL local);
  425. BOOLEAN    ZoomViewer3D (HVIEW hv, REAL zoom);
  426.  
  427. VOIDED    MoveTo3D (HDC hdc, REAL x, REAL y, REAL z);
  428. VOIDED    LineTo3D (HDC hdc, REAL x, REAL y, REAL z);
  429. VOIDED    MoveTo3H (HDC hdc, REAL x, REAL y, REAL z, REAL w);
  430. VOIDED    LineTo3H (HDC hdc, REAL x, REAL y, REAL z, REAL w);
  431. VOIDED    Line3D (HDC hdc, REAL x1, REAL y1, REAL z1,
  432.             REAL x2, REAL y2, REAL z2);
  433. VOIDED    Line3H (HDC hdc, REAL x1, REAL y1, REAL z1, REAL w1,
  434.             REAL x2, REAL y2, REAL z2, REAL w2);
  435.  
  436. VOIDED    RMoveTo3D (HDC hdc, REAL x, REAL y, REAL z);
  437. VOIDED    RLineTo3D (HDC hdc, REAL x, REAL y, REAL z);
  438. VOIDED    RLine3D (HDC hdc, REAL x, REAL y, REAL z, REAL dx, REAL dy, REAL dz);
  439.  
  440. VOIDED    PolyArrow3D (HDC hdc, WORD type, VECTOR poly, LPVECT3 dir, INT count,
  441.             REAL r, REAL l, REAL w, WORD htype);
  442. VOIDED    Label3D (HDC hdc, REAL x, REAL y, REAL z, LPSTR label);
  443. BOOLEAN    Mark3D (HDC hdc, REAL x, REAL y, REAL z,
  444.             INT hsize, INT vsize, WORD type);
  445. VOIDED     PolyMark3D (HDC hdc, WORD type, VECTOR point, INT count,
  446.             INT hsize, INT vsize, WORD htype);
  447.  
  448.  
  449. VOIDED    Polygon3D (HDC hdc, WORD type, VECTOR vertex, INT count);
  450. VOIDED    PolyPolygon3D (HDC hdc, WORD type, VECTOR vertex,
  451.             LPINT polycount, INT count);
  452. VOIDED    Polyline3D (HDC hdc, WORD type, VECTOR point, INT count);
  453. VOIDED    ClosedPolyline3D (HDC hdc, INT type, VECTOR point, INT count);
  454. VOIDED    MarkPosition3D (HDC hdc, REAL x, REAL y, REAL z, REAL size, WORD type);
  455. VOIDED    Pointer3D (HDC hdc, REAL x1, REAL y1, REAL z1, REAL x2, REAL y2,
  456.             REAL z2, REAL l, REAL w, WORD type);
  457. VOIDED    Arrow3D (HDC hdc, REAL x, REAL y, REAL z, REAL u, REAL v, REAL w,
  458.             REAL r, REAL l, REAL t, WORD type);
  459. VOIDED    Net3D (HDC hdc, WORD type, VECTOR point, INT m, INT n);
  460.  
  461. /*****************************************************************************
  462.  
  463.                         Shading Functions
  464.  
  465. *****************************************************************************/
  466.  
  467. VOIDED    ResetShader (void);
  468.  
  469. /* depth buffer functions */
  470. BOOLEAN    SetDepthBuffer (HVIEW hv);
  471. BOOLEAN    SelectDepthBuffer (HVIEW hv);
  472. BOOLEAN    FreeDepthBuffer (HVIEW hv);
  473. VOIDED    ClearDepthBuffer (WORD val);
  474.  
  475. /* light functions */
  476. BOOLEAN    CopyLight (HLITE hl1, HLITE hl2);
  477. BOOLEAN    ResetLight (HLITE hl);
  478. LITEHDL    SelectLight (HLITE hl);
  479. BOOLEAN    DeleteLight (HLITE hl);
  480. SGLWORD    LightType (HLITE hl);
  481. BOOLEAN    SwitchLight (HLITE hl, DWORD status);
  482. BOOLEAN    SetLightLocation (HLITE hl, REAL x, REAL y, REAL z);
  483. BOOLEAN    GetLightLocation (HLITE hl, LPREAL x, LPREAL y, LPREAL z);
  484. BOOLEAN    SetLightDirection (HLITE hl, REAL x, REAL y, REAL z);
  485. BOOLEAN    GetLightDirection (HLITE hl, LPREAL x, LPREAL y, LPREAL z);
  486. BOOLEAN    SetSpotlightSpread (HLITE hl, INT angle, INT spread);
  487. BOOLEAN    GetSpotlightSpread (HLITE hl, LPINT angle, LPINT spread);
  488.  
  489. /* material functions */
  490. BOOLEAN    DeleteMaterial (HMATE hm);
  491. MATEHDL    SelectMaterial (HMATE hm);
  492. BOOLEAN    CopyMaterial (HMATE hm1, HMATE hm2);
  493. BOOLEAN    ResetMaterial (HMATE hm);
  494.  
  495. DBLWORD    AmbientColor (COLORREF color);
  496. DBLWORD    LightColor (HLITE hl, COLORREF color);
  497. DBLWORD    MaterialSpecular (HMATE hm, COLORREF color);
  498. DBLWORD    MaterialAmbient (HMATE hm, COLORREF color);
  499. DBLWORD    MaterialDiffuse (HMATE hm, COLORREF color);
  500. DBLWORD    MaterialEmission (HMATE hm, COLORREF color);
  501. SGLWORD    MaterialShininess (HMATE hm, DWORD shininess);
  502. SGLWORD    LightIntensity (HLITE hl, DWORD intensity);
  503. LITEHDL    NewLight (WORD type);
  504. MATEHDL    NewMaterial (VOID);
  505. SGLWORD    LightCoordinateType (HLITE hl, DWORD type);
  506. STRING    LightName (HLITE hl, LPSTR name);
  507. STRING    MaterialName (HMATE hm, LPSTR name);
  508.  
  509. /* shading parameter functions */
  510. VOIDED    SetAttenuation (REAL k0, REAL k1, REAL k2);
  511. BOOLEAN    LocalViewer (DWORD on);
  512. BOOLEAN    DepthBuffer (DWORD on);
  513. BOOLEAN    TwoSideShading (DWORD on);
  514. BOOLEAN    BackFaceRemoval (DWORD on);
  515. BOOLEAN    PolygonDirection (DWORD countclock);
  516. SGLWORD    ShadingMethod (DWORD method);
  517. SGLWORD    ShadingModel (DWORD type);
  518.  
  519. HPALETTE WINAPI    SetRGBPalette (void);
  520.  
  521. /* shading primitive functions */
  522. BOOLEAN    _ShadeFacet (HDC hdc, VECTOR normal, WORD type, VECTOR vertex, INT count, LPVECT3 param);
  523. #define    ShadeFacet(hdc, normal, type, vertex, count, param)    \
  524. _ShadeFacet (hdc, normal, type, (VECTOR) vertex, count, param)
  525. BOOLEAN    _ShadePolygon (HDC hdc, VECTOR normal, WORD type, VECTOR point, INT count);
  526. #define    ShadePolygon(hdc, normal, type, point, count)    \
  527. _ShadePolygon(hdc, normal, type, (VECTOR) point, count)
  528. BOOLEAN    _ShadePolyPolygon (HDC hdc, VECTOR normal, WORD type, VECTOR vertex, LPINT pcount, INT count);
  529. #define    ShadePolyPolygon(hdc, normal, type, vertex, pcount, count)    \
  530. _ShadePolyPolygon (hdc, normal, type, (VECTOR) vertex, pcount, count)
  531.  
  532. BOOLEAN    ShadePolyFacet (HDC hdc, LPPOLYFACET polyfacet);
  533. BOOLEAN    ShadingPreview (HDC hdc, LPRECT rect, REAL r, REAL d);
  534. DBLWORD    ScaleColor (COLORREF color, REAL scale);
  535.  
  536. /* programmable shader functions */
  537. VOIDED    GetPixelPosition (LPINT x, LPINT y);
  538. VOIDED    GetPixelViewNormal (VECTOR normal);
  539. VOIDED    GetPixelWorldNormal (VECTOR normal);
  540. VOIDED    GetPixelObjectNormal (VECTOR normal);
  541. VOIDED    GetPixelViewCoordinate (VECTOR coord);
  542. VOIDED    GetPixelWorldCoordinate (VECTOR coord);
  543. VOIDED    GetPixelObjectCoordinate (VECTOR coord);
  544. VOIDED    GetPixelViewCameraAxis (VECTOR vaxis);
  545. VOIDED    GetPixelWorldCameraAxis (VECTOR vaxis);
  546. VOIDED    GetPixelObjectCameraAxis (VECTOR vaxis);
  547.  
  548. typedef void (CALLBACK *MATERIALPROC)(HMATE);
  549. typedef void (CALLBACK *NORMALPROC)(VECTOR);
  550. typedef void (CALLBACK *PIXELPROC)(LPDWORD);
  551. VOIDED    SetPerturbation (WORD type, void (CALLBACK* proc)());
  552.  
  553. BOOLEAN    ShadingPerturbation (WORD type, DWORD status);
  554. BOOLEAN    SolidTexture (WORD type);
  555.  
  556. /*****************************************************************************
  557.  
  558.                 Image Mapping and Printing Functions
  559.  
  560. *****************************************************************************/
  561.  
  562. typedef int (WINAPI *DRAWPROC)(HDC);
  563.  
  564. #define    VL_FLUSHTOP        0x0001
  565. #define    VL_FLUSHBOTTOM    0x0002
  566. #define    VL_FLUSHLEFT    0x0004
  567. #define    VL_FLUSHRIGHT    0x0008
  568.  
  569. #define    VL_HORZFIT        0x0010
  570. #define    VL_VERTFIT        0x0020
  571. #define    VL_ALLFIT        0x0030
  572. #define    VL_HORZCENTER    0x0040
  573. #define    VL_VERTCENTER    0x0080
  574.  
  575. #define    VL_HORZSCALED    0x0100
  576. #define    VL_VERTSCALED    0x0200
  577. #define    VL_BESTFIT        0x0400
  578. #define    VL_USE31APIS    0x0800
  579.  
  580. #define    VL_MILLIMETER    0x1000
  581. #define    VL_CENTIMETER    0x2000
  582. #define    VL_MARKCORNER    0x4000
  583. #define    VL_MARKPAGE        0x8000
  584.  
  585. BOOLEAN    ReadDIBFile (LPSTR fname, LPHANDLE hdib);
  586. HANDLE    WINAPI    ScreenToDIB (LPRECT rect);
  587. BOOLEAN    WriteDIBFile (LPSTR fname, HANDLE hdib);
  588. BOOLEAN    SetPrintRect (HDC hdc, LPRECT rect, WORD mode, REAL x, REAL y,
  589.             REAL w, REAL h, INT bw, INT bh);
  590. VOIDED    GetScreenRect (HWND hwnd, BOOL withframe, LPRECT rect);
  591. BOOLEAN    PrintImage (HANDLE hdib, WORD mode, REAL x, REAL y, REAL w, REAL h);
  592. BOOLEAN    PrintDrawing (DRAWPROC draw, WORD mode,
  593.             REAL x, REAL y, REAL w, REAL h);
  594. BOOLEAN    ImageMap2D (HDC hdc, HGLOBAL hdib, WORD type, VECTOR vertex);
  595. BOOLEAN    ImageMap3D (HDC hdc, HGLOBAL hdib, WORD type, VECTOR vertex);
  596.  
  597.  
  598. /* text parameter */
  599. #define    VL_TEXT_HEIGHT            0x0001
  600. #define    VL_TEXT_ASPECT            0x0002
  601. #define    VL_TEXT_THICKNESS        0x0004
  602.  
  603. BOOLEAN    TextParameter (WORD type, REAL param);
  604. BOOLEAN    SelectTrueTypeFont (void);
  605. BOOLEAN    SetFont (const LPLOGFONT lplf);
  606. BOOLEAN    Character2D (HDC hdc, REAL x, REAL y, REAL a, WORD character);
  607. BOOLEAN    Character3D (HDC hdc, REAL x, REAL y, REAL a, WORD character);
  608. BOOLEAN    SolidCharacter (HDC hdc, WORD character);
  609. BOOLEAN    Text2D (HDC hdc, REAL x, REAL y, REAL a, LPSTR text);
  610. BOOLEAN    Text3D (HDC hdc, REAL x, REAL y, REAL a, LPSTR text);
  611. BOOLEAN    SolidText (HDC hdc, LPSTR text);
  612. VOIDED    SetTextHeight (REAL height);
  613. VOIDED    GetTextHeight (LPREAL height);
  614. VOIDED    SetTextAspect (REAL aspect);
  615. VOIDED    GetTextAspect (LPREAL aspect);
  616. VOIDED    SetTextThickness (REAL thick);
  617. VOIDED    GetTextThickness (LPREAL thick);
  618.  
  619. /*****************************************************************************
  620.  
  621.                     2D Curve Functions
  622.  
  623. *****************************************************************************/
  624.  
  625. VOIDED    QBezierCurve2D (HDC hdc, WORD type, VECTOR poly);
  626. VOIDED    QBSplineCurve2D (HDC hdc, WORD type, VECTOR poly, INT count);
  627. VOIDED    QNURBSCurve2D (HDC hdc, WORD type, VECTOR poly, INT count, VECTOR knot);
  628.  
  629. VOIDED    BezierCurve2D (HDC hdc, WORD type, VECTOR poly);
  630. VOIDED    HermitCurve2D (HDC hdc, WORD type, VECTOR poly);
  631. VOIDED    BSplineCurve2D (HDC hdc, WORD type, VECTOR poly, INT count);
  632. VOIDED    NURBSCurve2D (HDC hdc, WORD type, VECTOR poly, INT count, VECTOR knot);
  633. VOIDED    SplineInterp2D (HDC hdc, WORD type, VECTOR poly, INT count);
  634.  
  635. VOIDED    BSplineCurveClosed2D (HDC hdc, WORD type, VECTOR poly, INT count);
  636. VOIDED    NURBSCurveClosed2D (HDC hdc, WORD type, VECTOR poly,
  637.             INT count, VECTOR knot);
  638.  
  639. VOIDED    CatmullRomSpline2D (HDC hdc, WORD type, VECTOR poly, INT count);
  640.  
  641.  
  642. /*****************************************************************************
  643.  
  644.                     3D Curve Functions
  645.  
  646. *****************************************************************************/
  647.  
  648. VOIDED    QBezierCurve3D (HDC hdc, WORD type, VECTOR poly);
  649. VOIDED    QBSplineCurve3D (HDC hdc, WORD type, VECTOR poly, INT count);
  650. VOIDED    QNURBSCurve3D (HDC hdc, WORD type, VECTOR poly, INT count, VECTOR knot);
  651. VOIDED    BezierCurve3D (HDC hdc, WORD type, VECTOR poly);
  652. VOIDED    HermitCurve3D (HDC hdc, WORD type, VECTOR poly);
  653. VOIDED    BSplineCurve3D (HDC hdc, WORD type, VECTOR poly, INT count);
  654. VOIDED    NURBSCurve3D (HDC hdc, WORD type, VECTOR poly, INT count, VECTOR knot);
  655. VOIDED    SplineInterp3D (HDC hdc, WORD type, VECTOR poly, INT count);
  656. VOIDED    BSplineCurveClosed3D (HDC hdc, WORD type, VECTOR poly, INT count);
  657. VOIDED    NURBSCurveClosed3D (HDC hdc, WORD type, VECTOR poly,
  658.             INT count, VECTOR knot);
  659. VOIDED    CatmullRomSpline3D (HDC hdc, WORD type, VECTOR poly, INT count);
  660. VOIDED    Spring (HDC hdc, INT count, REAL radius, REAL height);
  661.  
  662. /*****************************************************************************
  663.  
  664.                     3D Curve Functions
  665.  
  666. *****************************************************************************/
  667.  
  668. INTEGER    CircleSide (WORD side);
  669. VOIDED    TransfVertex (WORD type, REAL x, REAL y, REAL a, REAL sx, REAL sy, LPREAL vertex, INT count);
  670. INTEGER    RectangleVertex (WORD type, REAL x1, REAL y1, REAL x2, REAL y2, LPREAL vertex);
  671. INTEGER    BoxVertex (WORD type, REAL x, REAL y, REAL t, REAL sx, REAL sy, LPREAL vertex);
  672. INTEGER    NgonVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, LPREAL vertex);
  673. INTEGER    FlowerVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, REAL r, LPREAL vertex);
  674. INTEGER    StarVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, LPREAL vertex);
  675. INTEGER    ArcVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, REAL a, REAL b, LPREAL vertex);
  676. INTEGER    PieVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, REAL a, REAL b, LPREAL vertex);
  677. INTEGER    RingVertex (WORD type, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count, REAL a, REAL b, REAL w, LPREAL vertex);
  678. INTEGER    RoseVertex (WORD type, REAL x, REAL y, REAL a, REAL r, INT m, INT n, LPREAL vertex);
  679.  
  680. /*****************************************************************************
  681.  
  682.                 2D Primitive Functions
  683.  
  684. *****************************************************************************/
  685.  
  686. VOIDED    Rectangle2D (HDC hdc, REAL x1, REAL y1, REAL x2, REAL y2);
  687. VOIDED    Box2D (HDC hdc, REAL x, REAL y, REAL t, REAL w, REAL h);
  688. VOIDED    Disk2D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry);
  689. VOIDED    Pie2D (HDC hdc, REAL x, REAL y, REAL t,
  690.             REAL rx, REAL ry, REAL a, REAL b);
  691. VOIDED    Ring2D (HDC hdc, REAL x, REAL y, REAL t,
  692.             REAL rx, REAL ry, REAL a, REAL b, REAL w);
  693. VOIDED    Chord2D (HDC hdc, REAL x, REAL y, REAL t,
  694.             REAL rx, REAL ry, REAL a, REAL b);
  695. VOIDED    Ngon2D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count);
  696. VOIDED    Flower2D (HDC hdc, REAL x, REAL y, REAL t,
  697.             REAL rx, REAL ry, INT count, REAL ratio);
  698. VOIDED    Star2D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count);
  699. VOIDED    Arc2D (HDC hdc, REAL x, REAL y, REAL t,
  700.             REAL rx, REAL ry, REAL a, REAL b);
  701. VOIDED    Rose2D (HDC hdc, REAL x, REAL y, REAL t, REAL r, INT m, INT n);
  702.  
  703. VOIDED    Spiral2D (HDC hdc, REAL x, REAL y, REAL a, REAL b, REAL r, REAL dr);
  704.  
  705.  
  706. /*****************************************************************************
  707.  
  708.                 3D Primitive Functions
  709.  
  710. *****************************************************************************/
  711.  
  712. VOIDED    Rectangle3D (HDC hdc, REAL x1, REAL y1, REAL x2, REAL y2);
  713. VOIDED    Box3D (HDC hdc, REAL x, REAL y, REAL t, REAL sx, REAL sy);
  714. VOIDED    Ring3D (HDC hdc, REAL x, REAL y, REAL t,
  715.             REAL rx, REAL ry, REAL a, REAL b, REAL w);
  716. VOIDED    Disk3D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry);
  717. VOIDED    Pie3D (HDC hdc, REAL x, REAL y, REAL t,
  718.             REAL rx, REAL ry, REAL a, REAL b);
  719. VOIDED    Chord3D (HDC hdc, REAL x, REAL y, REAL t,
  720.             REAL rx, REAL ry, REAL a, REAL b);
  721. VOIDED    Ngon3D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count);
  722. VOIDED    Flower3D (HDC hdc, REAL x, REAL y, REAL t,
  723.             REAL rx, REAL ry, INT count, REAL r);
  724. VOIDED    Star3D (HDC hdc, REAL x, REAL y, REAL t, REAL rx, REAL ry, INT count);
  725.  
  726. VOIDED    Arc3D (HDC hdc, REAL x, REAL y, REAL t,
  727.             REAL rx, REAL ry, REAL a, REAL b);
  728. VOIDED    Rose3D (HDC hdc, REAL x, REAL y, REAL t, REAL r, INT m, INT n);
  729.  
  730. VOIDED    Spiral3D (HDC hdc, REAL a, REAL b, REAL r, REAL dr, REAL h);
  731. VOIDED    Spring3D (HDC hdc, REAL a, REAL b, REAL r, REAL h);
  732.  
  733.  
  734. /*****************************************************************************
  735.  
  736.                 3D Surface Functions
  737.  
  738. *****************************************************************************/
  739.  
  740. BOOLEAN    BezierSurface (HDC hdc, WORD type, VECTOR poly, INT ns, INT nt);
  741. BOOLEAN    HermitSurface (HDC hdc, WORD type, VECTOR poly, INT ns, INT nt);
  742. BOOLEAN    BSplineSurface (HDC hdc, WORD type, VECTOR poly,
  743.             INT Sc, INT Tc, INT ns, INT nt);
  744. BOOLEAN    NURBSSurface (HDC hdc, WORD type, VECTOR poly,
  745.             INT Sc, INT Tc, VECTOR Skn, VECTOR Tkn, INT ns, INT nt);
  746.  
  747. BOOLEAN    CoonsPatch (HDC hdc, WORD type, VECTOR point, INT nu, INT nv);
  748. BOOLEAN RevolveBezier (HDC hdc, WORD type, VECTOR poly, INT n, REAL angle);
  749. BOOLEAN RevolveHermit (HDC hdc, WORD type, VECTOR poly, INT n, REAL angle);
  750. BOOLEAN RevolveNURBS (HDC hdc, WORD type, VECTOR poly, INT count, VECTOR knot,
  751.             INT n, REAL angle);
  752. BOOLEAN RevolveBSpline (HDC hdc, WORD type, VECTOR poly, INT count,
  753.             INT n, REAL angle);
  754.  
  755. /*****************************************************************************
  756.  
  757.                             Solid Primitive Functions
  758.  
  759. *****************************************************************************/
  760.  
  761. BOOLEAN    Cube (HDC hdc, REAL w, REAL l, REAL h);
  762. BOOLEAN    Cylinder (HDC hDC, REAL rx, REAL ry, REAL h);
  763. BOOLEAN    Cone (HDC hDC, REAL rx, REAL ry, REAL h);
  764. BOOLEAN    Ellipsoid (HDC hdc, REAL a, REAL b, REAL c);
  765. BOOLEAN    Sphere (HDC hdc, REAL r);
  766. BOOLEAN    HemiSphere (HDC hdc, REAL r, REAL h);
  767. BOOLEAN    SolidStar (HDC hdc, INT count, REAL rx, REAL ry, REAL h);
  768. BOOLEAN    SolidFlower (HDC hdc, INT count, REAL r, REAL rx, REAL ry, REAL h);
  769. BOOLEAN    SolidPie (HDC hdc, REAL rx, REAL ry, REAL h, REAL a, REAL b);
  770. BOOLEAN    Frustum (HDC hdc, REAL bw, REAL bl, REAL tw, REAL tl, REAL h);
  771. BOOLEAN    Ridge (HDC hdc, REAL w, REAL l, REAL h, REAL r);
  772. BOOLEAN    Prism (HDC hdc, WORD type, VECTOR base, INT count, REAL h);
  773. BOOLEAN    Pyramid (HDC hdc, LPPOINT3D base, INT count, LPPOINT3D tip);
  774. BOOLEAN    WedgedCone (HDC hdc, REAL rx, REAL ry, REAL h, REAL a, REAL b);
  775. BOOLEAN    WedgedCylinder (HDC hdc, REAL rx, REAL ry, REAL h,
  776.             REAL tr, REAL a, REAL b);
  777. BOOLEAN    WedgedSphere (HDC hdc, REAL rx, REAL ry, REAL rz,
  778.             REAL a1, REAL a2, REAL b1, REAL b2);
  779. BOOLEAN    WedgedTorus (HDC hdc, REAL r1, REAL r2,
  780.             REAL a1, REAL a2, REAL b1, REAL b2);
  781.  
  782. BOOLEAN    Torus (HDC hdc, REAL r1, REAL r2);
  783.  
  784. BOOLEAN    SolidRing (HDC hdc, REAL rtop, REAL rbot, REAL t, REAL h, REAL a,
  785.             REAL b, REAL ratio);
  786. BOOLEAN    Tube (HDC hdc, REAL rtop, REAL rbot, REAL t, REAL h);
  787. BOOLEAN    Sweep (HDC hdc, MATRIX transf, INT nstep, LPVECT3 vertex,
  788.             LPVECT3 normals, INT npts, WORD mode, VECTOR snormal);
  789. BOOLEAN    Revolution (HDC hdc, LPVECT3 vertex, LPVECT3 normal, INT n,
  790.             REAL angle, WORD mode, VECTOR snormal);
  791. BOOLEAN    Tetrahedron (HDC hdc, REAL r);
  792. BOOLEAN    Octahedron (HDC hdc, REAL r);
  793. BOOLEAN    Dodecahedron (HDC hdc, REAL r);
  794. BOOLEAN    Icosahedron (HDC hdc, REAL r);
  795.  
  796. /*****************************************************************************
  797.  
  798.                             Object Array Functions
  799.  
  800. *****************************************************************************/
  801.  
  802. typedef    BOOL (WINAPI *BidimArrayProc)(HDC hdc, INT row, INT col);
  803. typedef BOOL (WINAPI *TridimArrayProc)(HDC hdc, INT row, INT col, INT lev);
  804.  
  805. BOOLEAN    RectangularArray2D (HDC hdc, INT m, INT n,
  806.             REAL xinc, REAL yinc, BidimArrayProc fp);
  807. BOOLEAN    RectangularArray3D (HDC hdc, INT m, INT n,
  808.             REAL xinc, REAL yinc, BidimArrayProc fp);
  809. BOOLEAN    PolarArray2D (HDC hdc, INT m, INT n,
  810.             REAL roff, REAL ainc, REAL rinc, BidimArrayProc);
  811. BOOLEAN    PolarArray3D (HDC hdc, INT m, INT n,
  812.             REAL roff, REAL ainc, REAL rinc, BidimArrayProc);
  813. BOOLEAN    CubicArray (HDC hdc, INT m, INT n, INT l,
  814.             REAL xinc, REAL yinc, REAL zinc, TridimArrayProc fp);
  815. BOOLEAN    CylindricArray (HDC hdc, INT m, INT n, INT l,
  816.             REAL roff, REAL ainc, REAL rinc, REAL zinc,
  817.             TridimArrayProc fp);
  818. BOOLEAN    SphericArray (HDC hdc, INT m, INT n, INT l,
  819.             REAL roff, REAL toff, REAL ainc, REAL rinc, REAL tinc,
  820.             TridimArrayProc fp);
  821.  
  822. /* Coordinate Transformation Function */
  823.  
  824. VOIDED    MultiplyMatrix3D (MATRIX a, MATRIX b, MATRIX c);
  825. VOIDED    MultiplyVector3D (MATRIX m, VECTOR a, VECTOR b);
  826. VOIDED    MultiplyVectorTranspose3D (MATRIX m, VECTOR a, VECTOR b);
  827. VOIDED    ConcatMatrix3D (MATRIX a, MATRIX b, BOOL post);
  828. VOIDED    TransformXYZ (MATRIX m, REAL u, REAL v, REAL w, LPREAL x, LPREAL y, LPREAL z);
  829. BOOLEAN    TransformCoordinate3D (MATRIX m, VECTOR a, VECTOR b);
  830. VOIDED    TransformCoordinate3H (MATRIX m, VECTOR a, VECTOR b);
  831. SGLWORD    TransformationMode3D (WORD type);
  832. VOIDED    TransformCoordinates3D (MATRIX m, VECTOR a, VECTOR b, INT n, WORD mode);
  833. VOIDED    TransformPoint3H (MATRIX m, LPPOINT3H a, LPPOINT3H b);
  834. VOIDED    TransformBase3D (MATRIX m, VECTOR a, VECTOR b, VECTOR c);
  835. VOIDED    TransformNormal3D (MATRIX m, VECTOR a, VECTOR b);
  836.  
  837. /* 3D Transformation Matrix */
  838.  
  839. VOIDED    SetTranslationMatrix3D (MATRIX m, REAL x, REAL y, REAL z);
  840. VOIDED    SetScaleMatrix3D (MATRIX m, REAL x, REAL y, REAL z);
  841. VOIDED    SetCenterScaleMatrix3D (MATRIX m, REAL x, REAL y, REAL z,
  842.             REAL sx, REAL sy, REAL sz);
  843. VOIDED    SetTranScaleMatrix3D (MATRIX m, REAL tx, REAL ty, REAL tz,
  844.                         REAL sx, REAL sy, REAL sz);
  845. VOIDED    SetXRotationMatrix3D (MATRIX m, REAL a);
  846. VOIDED    SetYRotationMatrix3D (MATRIX m, REAL a);
  847. VOIDED    SetZRotationMatrix3D (MATRIX m, REAL a);
  848. VOIDED    SetRotationMatrix3D (MATRIX m, REAL a, char axis);
  849. VOIDED    SetTransformation3D (MATRIX m, REAL x, REAL y, REAL a, REAL sx, REAL sy);
  850. VOIDED    SetBaseMatrix3D (MATRIX m, VECTOR x, VECTOR y, VECTOR t);
  851. VOIDED    SetAxleMatrix3D (MATRIX m, VECTOR ref, VECTOR dir);
  852. VOIDED    SetPlaneMatrix3D (MATRIX m, VECTOR plane);
  853. VOIDED    SetOperationMatrix3D (MATRIX m, MATRIX base, MATRIX operation);
  854. VOIDED    SetAxleRotationMatrix3D (MATRIX m, VECTOR ref, VECTOR dir, REAL a);
  855. VOIDED    SetStretchMatrix3D (MATRIX m, VECTOR ref, VECTOR dir, REAL f);
  856. VOIDED    SetMirrorMatrix3D (MATRIX m, VECTOR ref, VECTOR dir);
  857. VOIDED    SetShearMatrix3D (MATRIX m, VECTOR ref, VECTOR dir, REAL u, REAL v);
  858. VOIDED    SetPointScaleMatrix3D (MATRIX m, REAL x, REAL y, REAL z, REAL sx, REAL sy, REAL sz);
  859.  
  860. #ifdef __cplusplus
  861. }
  862. #endif
  863.